package cn.edu.scau.dormitory_management_system.module.examine.dao;

import cn.edu.scau.dormitory_management_system.module.examine.entity.CheckinAuditEntity;
import cn.edu.scau.dormitory_management_system.module.examine.entity.VO.CheckinAuditVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CheckinAuditDao extends BaseMapper<CheckinAuditEntity> {
    @Select("select *,is_passed as passed from tb_checkin_audit TCA, tb_flow_node TFN where checkin_id=#{checkinId} and TCA.flow_node_id=TFN.flow_node_id")
    List<CheckinAuditVO> listAuditVOByCheckinId(Integer checkinId);

    @Delete("delete from tb_checkin_audit where checkin_id = #{id}")
    boolean deleteByCheckinId(Integer id);
}
